-
Notifications
You must be signed in to change notification settings - Fork 40
[930][evaluation] implement CSVReader #932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iluise I have not tried it but I trust you did. Approved, and here are a couple of comments (small)
| self.csv_path = eval_cfg.get("csv_path") | ||
| assert self.csv_path is not None, "CSV path must be provided in the config." | ||
|
|
||
| self.data = pd.read_csv(self.csv_path, index_col=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one thing I would do is cast all the values to np.float32 (or float). pandas tries to be very clever and would for example use int32 if the data allows. I am not sure if xarray can deal with that later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you have a object that can be an instance of different subclasses and you want different behavior depending on the subclass, you should use polymorphism to implement it: Make a method with the same function signature in both subclasses and implement the different behavior there. The advantage is that the caller does not have to have any knowledge of the differnces (As you do here).
|
|
||
| data: pd.DataFrame | None # Data attributes (if specified) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class level attribute is only used for differentiating between Subclasses. Use polymorphism as I described below instead.
| ) | ||
| _logger.debug(f"Looking for: {score_path}") | ||
|
|
||
| if score_path.exists(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should be a method of Reader/CsvReader. That way you dont have to do the if reader.data is not None statement: It will already be included when the WeatherGenReader/CsvReader is instatiated. This way you also dont need the data class attribute
Description
Add reader to retrieve CSV scores from files generated with Quaver. @Jubeku
quaver scores can be plotted in the FastEvaluation package by adding this in the config (you need to have them locally first):
Issue Number
Closes #930
Is this PR a draft? Mark it as draft.
Checklist before asking for review
./scripts/actions.sh lint./scripts/actions.sh unit-test./scripts/actions.sh integration-testlaunch-slurm.py --time 60